package cn.xbtop.config;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.jms.Queue;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/6/11 14:48
 */
@Configuration
@ConditionalOnClass(value = ActiveMQQueue.class)
public class ActiveMQConfig {
    @Value("${boot-queue}")
    private String queueName;

    @Bean
    public Queue queue(){
        return new ActiveMQQueue(queueName);
    }

}
